import request from "@/utils/request.js";

// 查询分类品牌列表
export function listCategoryBrand(query) {
    return request({
        url: '/product/categoryBrand/list',
        method: 'GET',
        params: query
    })
}

// 获取全部品牌
export function getBrandAll() {
    return request({
        url: '/product/brand/getBrandAll',
        method: 'GET'
    })
}

// 新增分类品牌
export function addCategoryBrand(data) {
    return request({
        url: '/product/categoryBrand',
        method: 'POST',
        data: data
    })
}

// 查询分类品牌详细
export function getCategoryBrand(id) {
    return request({
        url: '/product/categoryBrand/' + id,
        method: 'GET'
    })
}

// 修改分类品牌
export function updateCategoryBrand(data) {
    return request({
        url: '/product/categoryBrand',
        method: 'PUT',
        data: data
    })
}

// 删除分类品牌
export function deleteCategoryBrand(id) {
    return request({
        url: '/product/categoryBrand/' + id,
        method: 'DELETE'
    })
}

// 根据分类获取分类品牌
export function getCategoryBrandAll(categoryId) {
    return request({
        url: '/product/categoryBrand/brandList/' + categoryId,
        method: 'get'
    })
}